<?php
defined('IN_TS') or die('Access Denied.');

switch($ts){
	//APP配置选项
	case "options":
		$arrOption = array(
			'appname' => trim($_POST['appname']),
			'appdesc' => trim($_POST['appdesc']),
			'isenable' => trim($_POST['isenable']),
			'mailhost' => trim($_POST['mailhost']),
			'mailport' => trim($_POST['mailport']),
			'mailuser' => trim($_POST['mailuser']),
			'mailpwd' => trim($_POST['mailpwd']),
		);

		foreach ($arrOption as $key => $val){
			$DB->query("UPDATE ".dbprefix."app_mail_options SET optionvalue='$val' where optionname='$key'");
		}
		
		AppCacheWrite($arrOption,'mail','options.php');
		
		//qiMsg("系统选项更新成功，并重置了缓存文件^_^");
		
		header("Location: index.php?app=mail&ac=admin&mg=options");
		break;
		 
}